package com.lyj.io.module.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户
 *
 * @author: 李亚杰
 * @version: 1.0
 * @date: 2021/8/19 14:53
 */
@ApiModel("用户表")
@Data
@TableName("sys_user")
public class SysUser implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", example = "")
    @TableId(type = IdType.ASSIGN_ID)
    private String userId;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称", example = "")
    private String nickname;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名", example = "")
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", example = "")
    private String password;

    /**
     * 盐
     */
    @ApiModelProperty(value = "盐", example = "")
    private String salt;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", example = "")
    private String email;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", example = "")
    private String mobile;

    /**
     * 状态  0：禁用   1：正常
     */
    @ApiModelProperty(value = "状态  0：禁用   1：正常", example = "")
    private Integer status;

    /**
     * 性别  0：男   1：女
     */
    @ApiModelProperty(value = "性别  0：男   1：女", example = "")
    private Integer sex;

    /**
     * 地址
     */
    @ApiModelProperty(value = "地址", example = "")
    private String address;

    /**
     * 上次登录IP
     */
    @ApiModelProperty(value = "上次登录IP", example = "")
    private String lastLoginIp;

    /**
     * 上次登录时间
     */
    @ApiModelProperty(value = "上次登录时间", example = "")
    @TableField(value = "LAST_LOGIN_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date lastLoginTime;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人", example = "")
    private Long creater;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "")
    @TableField(value = "CREATE_DATE", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createDate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", example = "")
    @TableField(value = "UPDATE_DATE", fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date updateDate;

    /**
     * vip标识
     */
    @ApiModelProperty(value = "vip标识", example = "")
    private Integer vip;

    /**
     * 删除标识
     */
    @ApiModelProperty(value = "删除标识,默认为0", example = "")
    private String deleteFlag;

    /**
     * 角色ID列表
     */
    @ApiModelProperty(value = "角色ID列表", example = "")
    @TableField(exist = false)
    private List<Long> roleIdList;
}
